<?php

/**
 * Controleur permettant de lister l'ensemble des offres
 */
if ($_SESSION['niveauAuth']=='1') {

if(isset($_POST['contenu']))
{
	$myFile = "facture.txt";
	$fh = fopen($myFile, 'w+');	
	fputs($fh,$_POST['contenu']);
	fclose($fh);
}

$myFile = "facture.txt";
$fh = fopen($myFile, 'r');
$contenu = fread($fh, filesize($myFile));
fclose($fh);

// Rendu de la page
echo $twig->render('gestion-bas-facture.html', 
		array(	'contenu' => $contenu,
				'message' => $message, 
				'error' => $error));
}
else {
	redirect("home-admin");
}